package com.jiyici.utils;

import android.app.Activity;
import android.content.Context;
import android.view.ViewGroup;

import com.devspark.appmsg.AppMsg;
import com.jiyici.R;

public class NotificationUtil {

    private static AppMsg.Style style = new AppMsg.Style(AppMsg.LENGTH_SHORT, R.color.actionbar_color);

    public static void notifyError(Context context, CharSequence message) {
        AppMsg.makeText((Activity) context, message, AppMsg.STYLE_ALERT).setDuration(AppMsg.LENGTH_SHORT).show();
    }

    public static void notifyError(Context context, int messageResourceId) {
        AppMsg.makeText((Activity) context, messageResourceId, AppMsg.STYLE_ALERT).setDuration(AppMsg.LENGTH_SHORT)
                .show();
    }

    public static void notifyInfo(Context context, CharSequence message) {
        AppMsg.makeText((Activity) context, message, style).setDuration(AppMsg.LENGTH_SHORT).show();
    }

    public static void notifyInfo(Context context, int messageResourceId) {
        AppMsg.makeText((Activity) context, messageResourceId, style).setDuration(AppMsg.LENGTH_SHORT).show();
    }

    public static void notifyError(ViewGroup view, CharSequence message) {
        AppMsg.makeText(view, message, AppMsg.STYLE_ALERT).setDuration(AppMsg.LENGTH_SHORT).show();
    }

    public static void notifyError(ViewGroup view, int messageResourceId) {
        AppMsg.makeText(view, messageResourceId, AppMsg.STYLE_ALERT).setDuration(AppMsg.LENGTH_SHORT).show();
    }
    
    public static void notifyInfo(ViewGroup view, CharSequence message) {
        AppMsg.makeText(view, message, style).setDuration(AppMsg.LENGTH_SHORT).show();
    }

    public static void notifyInfo(ViewGroup view, int messageResourceId) {
        AppMsg.makeText(view, messageResourceId, style).setDuration(AppMsg.LENGTH_SHORT).show();
    }
}
